package com.fiberhome.nas.core.ui.component.image

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import com.fiberhome.nas.core.designsystem.theme.BodyMedium
import com.fiberhome.nas.core.designsystem.theme.SpacePaddingSmall
import com.fiberhome.nas.core.ui.component.text.AppText

@Composable
fun TextImage(
    modifier: Modifier = Modifier,
    icon: ImageVector,
    text: String,
    onClick: () -> Unit = {},
) {
    Column(
        horizontalAlignment = Alignment.CenterHorizontally,
        modifier = Modifier
            .padding(8.dp)
            .clickable { onClick() }
    ) {
        Image(
            imageVector = icon,
            contentDescription = "图片描述",
            modifier = Modifier.size(24.dp)
        )
        SpacePaddingSmall
        AppText(text = text, style = BodyMedium)
    }
}